pp108 : Accessing XForms and Translations using URLs

Accessing XForms and Translations using URLs

This topic describes the procedure to access XForms and translations using URLs.

Accessing XForms

At run time, an XForm may be used as a standalone XForm, or as an application in the Process Platform application. In both the cases, you can access XForms from a browser by specifying its Uniform Resource Locator (URL).
To access an XForm within the Process Platform application, use the following URL format:

<url>/cordys/<folder name>/.../<folder name>/<XForm name>.caf?[organization=OrganizationDN]

For example, to accessfile1.cafunderfolder1in the Process Platform application, the URL will be<url>/cordys/folder1/file1.caf</url>.
To open a standalone XForm, use the following URL format:

http://<server name:port number>/cordys/<folder name>/.../<folder name>/<XForm name>.caf?[organization=OrganizationDN]

where, port number refers to the port specified while installing Process Platform. If no port number is specified, mention only the server name.
For example, to access a standaloneform 1.caf from an external application example.com, the URL will be _http://example.com/cordys/folder1/file1.caf_.

You must specify the folder path in the same way in which it was structured during design time under the Application Models repository.
The organization attribute in the URL is optional. You can use this attribute to access XForms from organizations other than yours. To access an organization, specify the organization name or its distinguished name (DN).

Accessing Translations

Viewing Translations of a Single XForm

Once an XForm is translated, you can view it in any of the translation languages specified in the XForm. You can use the query string to specify the language in which to view a single, translated XForm.
To view a translated XForm in the Process Platform application, specify the language code in the URL of the XForm as follows:

<url>/cordys/<folder name>/.../<folder name>/<XForm name>.caf?language=nl</url>

To view a translated, standalone XForm, specify the URL of the XForm in the following format:

http://<server name:port number>/cordys/<folder name>/.../<folder name>/<XForm name>.caf?[organization=<organization DN>&amp;language=<language code>]

where, port number refers to the port specified at the time of installing Process Platform. If no port number is specified, mention only the server name.
You must specify the folder path as it is displayed under the Application Models repository.
Both the organization and language attributes in the URL are optional. You must specify both the attributes to access a translated XForm from organizations other than yours.
To access a translated XForm in the current organization, use the language parameter only.

Note:

  • If the language settings on your computer are set to a language for which translation is available, the XForm appears in the set language, by default.
  • If the language set for your computer varies from the translation language that you specify in the URL, the XForm appears in the language specified in the URL.
Viewing Translations of Multiple XForms

You can modify the system parameters such that XForms automatically appear in a translated language. To do so, you need to set the language code as an extensible parameter of .caf in the system parameter collection as follows:

 if (! system.parameters['.caf']) system.parameters['.caf'] = new Array(); system.parameters['.caf']['language'] = '<language code>';

This causes all XForms to appear in the specified translation language.

Important
If the authentication for the Cordys website is set as Anonymous Access in Microsoft IIS or Apache), the Authentication Details dialog box appears when you try to access Process Platform or use URLs to access standalone XForms or their translations. To access Process Platform, you must specify your Process Platform application username and password.

Note:
While translating multiple XForms, the XForm on which the language code is set is not translated, you must translate it as any other standalone XForm. A combination of both the above approaches enables you to view all XForms in the required language. Also, the language set on the query string (as for translating standalone XForms) takes precedence over the language set on the parameter (as for translating multiple XForms).

Viewing Translations of XForms based on Browser Settings

In the above sections, it is assumed that the translated language is specified in the URL. However, in some cases the URL may not contain information about the language in which the XForm must be displayed at runtime.
In these cases, the languages specified in the browser and translation languages specified in the XForm (saved in the .mlm file) are considered while displaying a translated XForm. The selection of the translation language is based on the criteria given below.

  • The languages set in the browser are given higher priority if no language is specified in the URL of the XForm.
  • If any of the browser languages exactly match the translation language specified in the XForm, the XForm is displayed in that language at runtime. For example, if the browser languages are specified in the order - en-AU, hi-IN, te-IN; and the translation languages specified in the XForm are
    hi-IN, sr-Cyrl, es-CL, the XForm will be displayed in hi-IN, which is the first exact match.
  • If none of the browser languages exactly match the translation language specified in the XForm, then language codes mentioned in the browser are truncated and again used to find a match. This is done for consecutive browser languages till a match is found. For example, if the browser languages are specified in the order - en-AU, sr-Cyrl-BA, te-IN; and the translation languages specified in the XForm are sr-Cyrl, ta-IN, es-CL, there is no exact language match possible. In this case, the browser language en-AU will be truncated to en and searched for a match. Since, no match is available for en, the consecutive language sr-Cyrl-BA is truncated to sr-Cyrl and searched for a match. Since a match is available for sr-Cyrl, the XForm will be translated and displayed in sr-Cyrl.
  • If no match is found in the browser languages and translation languages specified in the XForm, the XForm is displayed as is.

Related tasks

Translating Text to a Target Language
Translating XForms

Related reference

translate()